<?php
global $_GPC, $_W;
$uniacid = $_W['uniacid'];
$id = $_GPC['id'];
$op = $_GPC['op'];
$cate_id = $_GPC['cate_id'];
$res = $this->res;
$plus = $this->plus;
load()->func('tpl');
$setting = $this->baseset($uniacid);
$condition = " AND status=1";
$nowpage = $_GPC['limit'];
$pindex = max(1, intval($nowpage));
if ($setting['pageno']) {
	$psize = $setting['pageno'];
} else {
	$psize = 10;
}
$list = pdo_fetchall("SELECT * FROM " . tablename($this->tabletop) . " WHERE uniacid = '{$_W['uniacid']}' $condition order by displayorder desc,id desc LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
if (empty($list)) {
	exit(json_encode(array('status' => 301, 'content' => $list)));
}
if (!empty($list)) {
	foreach ($list as $key => $value) {
		$list[$key]['thumb'] = tomedia($list[$key]['thumb']);
		$list[$key]['jumpurl'] = $this->createMobileUrl('list_top', array('id' => $list[$key]['id']));
	}
	$sta = 200;
} else {
	$sta = -103;
}
exit(json_encode(array('status' => $sta, 'content' => $list)));